<%--用户待审核笔记界面--%>

<%@ page import="dao.impl.NoteDaoImpl" %>
<%@ page import="java.util.ArrayList" %>
<%@ page import="pojo.Note" %><%--
  Created by IntelliJ IDEA.
  User: tangms
  Date: 2022/4/4
  Time: 9:16
  To change this template use File | Settings | File Templates.
--%>
<%@ page contentType="text/html;charset=UTF-8" language="java" %>
<%@ taglib prefix="c" uri="http://java.sun.com/jsp/jstl/core" %>
<html>
<head>
    <title>Title</title>
</head>
<style>
    *{
        margin: 0px;
        padding: 0px;
        box-sizing: border-box;
    }
    .title_left{
        margin-left: 420px;
    }
    .back,.delete{
        margin-left: 790px;
    }
    .content_left{
        border:1px solid black;
        width: 440px;
        margin-left: 420px;
        height: 100px;
        margin-bottom: 20px;
    }
    .type{
        margin-left: 420px;
    }
    .page{
        margin-left: 420px;
    }
    .active{
        border:1px solid lightskyblue;
        background-color:lightskyblue;
        width:12px;
        height:10px;
    }
    .nonactive{
        border:1px solid black;
        width:12px;
        height:10px;
    }
</style>
<script>
    function deleteNote(nid,usename){
        if(confirm("您确定删除吗？")){
            location.href="${pageContext.request.contextPath}/noteServlet?action=userDeleteNoteInCheckedNotes&nid="+nid+"&usename="+usename;
        }
    }
</script>
<body>
<h3 align="center">个人待审核笔记</h3>
<%--<a href="allAreas.jsp" type="submit" class="back">返回首页</a>--%>

<%
    String usename= (String) session.getAttribute("usename");
//    ImplementNote implementNote=new ImplementNote();
//    ArrayList<Note> checkednotes=new ArrayList<Note>();
//    checkednotes=implementNote.user_checkednote(usename);
//    request.setAttribute("checkednotes",checkednotes);
    request.getParameter("page");
    int i=0;
    request.setAttribute("order",i);
    request.setAttribute("usename",usename);
%>
<a href="${pageContext.request.contextPath}/pageServlet?usename=${usename}&action=userNotePage" class="back" type="submit">返回个人笔记页</a>
<c:forEach items="${page.list}" var="note" varStatus="s">
    <form>
        <table>
            <tr>
                <td>
                    <h5 class="title_left" name="title">${order=order+1}.${note.title}</h5>
                    <h5 class="type">${note.type}</h5>
                 <a href="javascript:deleteNote('${note.nid}','${usename}');" class="delete" type="submit">删除</a>
                   <c:if test="submit.onclick"></c:if>
                    <p class="content_left" name="content">${note.content}</p>
                </td>
            </tr>
        </table>
    </form>
</c:forEach>
<div class="page">
    <nav aria-label="page navigation">
        <ul class="pagination">
            <c:if test="${page.currentPage==1}">
    <span aria-label="Previous">
        <span aria-hidden="true">&laquo;</span>
    </span>
            </c:if>
            <c:if test="${page.currentPage!=1}">
                <a href="${pageContext.request.contextPath}/pageServlet?action=userCheckedNotesPage&currentPage=${page.currentPage-1}&rows=5&usename=${usename}" aria-label="Previous">
                    <span aria-hidden="true">&laquo;</span>
                </a>
            </c:if>
            <c:forEach begin="1" end="${page.totalPage}" var="i">

                <c:if test="${page.currentPage==i}">
                    <a href="${pageContext.request.contextPath}/pageServlet?action=userCheckedNotesPage&currentPage=${i}&rows=5&usename=${usename}"  class="active">${i}</a>
                </c:if>
                <c:if test="${page.currentPage!=i}">
                    <a href="${pageContext.request.contextPath}/pageServlet?action=userCheckedNotesPage&currentPage=${i}&rows=5&usename=${usename}" class="nonactive">${i}</a>
                </c:if>
            </c:forEach>
            <c:if test="${page.currentPage!=page.totalPage}">
                <a href="${pageContext.request.contextPath}/pageServlet?action=userCheckedNotesPage&currentPage=${page.currentPage+1}&rows=5&usename=${usename}" aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </a>
            </c:if>
            <c:if test="${page.currentPage==page.totalPage}">
                <span aria-label="Next">
                    <span aria-hidden="true">&raquo;</span>
                </span>
            </c:if>
            <span style="font-size: 20px;margin-left: 5px;">
                共${page.total}条笔记，共${page.totalPage}页
            </span>
        </ul>
    </nav>
</div>
</body>
</html>
